package app

import (
	"GoMaestro/internal/strategy"
	"time"
)

// App  针对于发布事务的项应用
type App struct {
	AppID                  int    `gorm:"primaryKey;autoIncrement" json:"app_id"`
	AppName                string `gorm:"size:255;not null" json:"app_name"`
	Owner                  string `gorm:"size:100;not null" json:"owner"`
	Language               string `gorm:"size:100;not null" json:"language"`
	Description            string `gorm:"size:255;default:'NULL'" json:"description"`
	GitURL                 string `gorm:"size:255;not null" json:"git_url"`
	Specify                string `gorm:"type:varchar(100);default:NULL" json:"specify"`
	strategy.ProjectAction `gorm:"-" json:"-"`
	CreatedAt              time.Time  `gorm:"type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt              time.Time  `gorm:"type:timestamp;not null;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" json:"updated_at"`
	DeletedAt              *time.Time `gorm:"type:timestamp;default:null" json:"deleted_at"`
}

// TableName 指定数据库表名（可选）
func (App) TableName() string {
	return "apps"
}
